package mapred;

import java.io.IOException;
import java.util.Iterator;

import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.Reporter;

public abstract class AbstractCombiner<K extends Writable, V extends Writable> extends
		AdvancedMapReduceBase implements Reducer<K, V, K, V> {

	@Override
	public void reduce(K key, Iterator<V> values, OutputCollector<K, V> output,
			Reporter reporter) throws IOException {
		combine(key, values, output, reporter);
	}

	protected abstract void combine(K key, Iterator<V> values,
			OutputCollector<K, V> output, Reporter reporter) throws IOException;

}
